<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>宇成建筑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="../statics/css/font.css">
    <link rel="stylesheet" href="../statics/plugins/layui/css/layui.css">
    <link rel="stylesheet" href="../statics/css/xadmin.css">
    <link rel="stylesheet" href="../statics/css/style.css">
    <style>
        .layui-card-body h3{
            cursor: pointer;
        }
        .layui-card-body h3:hover{
            color:#01AAED
        }
        button.right{
            float:right;
            margin:6px 0;
        }
    </style>
</head>

<body class='labelAuto'>
<div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="welcome.html">首页</a>
            <a href="javascript:;">审批</a>
            <a href="javascript:;">审批</a>
            <a><cite>杂工量价</cite></a>
        </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right;margin-right:10px"
       onclick="window.history.go(-1)" title="后退">
        <i class="iconfontBlod" style="line-height:30px">&#xe74f;</i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-d layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <!--                <div class="layui-card-body">暂无数据</div>-->
                <div class="layui-card-body">
                    <!--                    <div class="layui-collapse" lay-accordion>-->
                    <!--                        <div class="layui-colla-item">-->
                    <!--                            <h2 class="layui-colla-title">shigongqu</h2>-->
                    <!--                            <div class="layui-colla-content">-->
                    <!--                                <h3>cesshshs</h3>-->
                    <!--                                <h3>cesshshs</h3>-->
                    <!--                                <h3>cesshshs</h3>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->
                </div>
            </div>
        </div>

    </div>
</div>
</body>
<script src="../statics/plugins/layui/layui.js" charset="utf-8"></script>
<script src='../statics/plugins/jQuery-3.2.1/jquery-3.2.1.min.js'></script>
<script type="text/javascript" src="../statics/plugins/X-admin/xadmin.js"></script>
<script type="text/javascript" src="../statics/js/public.js?v=1129"></script>
<script type="text/javascript">
    layui.use(['element'], function () {
        var element = layui.element
        // 异步数据加载
        var approvalId = getQueryString('approvalId');
        var projectId = getQueryString('projectId');
        var areaId = getQueryString('areaId');
        var month = getQueryString('month');
        var data = [];
        element.render('collapse');
        $.ajax({
            type:"post",
            url:url+'/approval/approval/approvalDataHandymanAccounts',
            async:false,
            data:{
                approvalId:approvalId,
                projectId:projectId,
                areaId:areaId,
                month:month,
                token:getParam('token')
            },
            success:function(r){
                if(r.code == 100000){
                    data = r.data;
                }else{
                    tips('审批',r)
                }
            }
        });
        var html = `<div class="layui-collapse" lay-accordion>`
        for(var i=0;i<data.length;i++){
            html+=`<div class="layui-colla-item">
                            <h2 class="layui-colla-title">施工区：${data[i].name}&nbsp;&nbsp;&nbsp;&nbsp;${data[i].sum}元</h2>
                            <div class="layui-colla-content">`
            for(var j=0;j<data[i].profession.length;j++){
                html+=`<h3 data-id="${data[i].profession[j].id}" data-sectionid="${data[i].id}">${data[i].profession[j].name}：&nbsp;&nbsp;&nbsp;&nbsp;${data[i].profession[j].sum}元</h3>`
            }
            html+= `</div></div>`
        }
        html += `</div>`
        $('.layui-card-body').empty().html(html);
        element.render('collapse')

        $('.layui-card-body').on('click','h3',function(){
            var sectionId = $(this).data('sectionid');
            var professionId = $(this).data('id');
            window.location.href = 'approvalDataHandymanAccountInfo.html?month='+month+'&sectionId='+sectionId+'&professionId='+professionId+'&projectId='+projectId+'&approvalId='+approvalId;
        })
    });

</script>
</html>